Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vitejs/plugin-react

Package Overview
Dependencies
Maintainers
5
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vitejs/plugin-react

The default Vite plugin for React projects.

  • 4.3.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.6M
decreased by-6.06%
Maintainers
5
Weekly downloads
 
Created

What is @vitejs/plugin-react?

The @vitejs/plugin-react package is a plugin for Vite that enables React fast refresh and other React-specific optimizations in a Vite project. It provides out-of-the-box configuration for a seamless development experience when working with React and Vite.

What are @vitejs/plugin-react's main functionalities?

Fast Refresh

Enables React Fast Refresh, which allows you to get instant feedback for changes in your React components during development without losing component state.

import reactRefresh from '@vitejs/plugin-react';

export default {
  plugins: [reactRefresh()],
};

JSX Transform

Automatically transforms JSX without the need for importing React in every file, thanks to the new JSX transform introduced in React 17.

import reactRefresh from '@vitejs/plugin-react';

export default {
  plugins: [reactRefresh()],
};

Custom Babel Configuration

Allows for custom Babel configurations to be used alongside the plugin, enabling advanced use cases and compatibility with additional Babel plugins.

import reactRefresh from '@vitejs/plugin-react';

export default {
  plugins: [reactRefresh({ babel: { plugins: ['@babel/plugin-syntax-dynamic-import'] } })],
};

Other packages similar to @vitejs/plugin-react

FAQs

Package last updated on 26 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc